/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * GUI.java
 *
 * Created on 2009-maj-06, 15:56:31
 */

package tletlis.UI;

import java.awt.Component;
import java.awt.Dimension;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JFrame;
import javax.swing.JPanel;
import tletlis.controller.Update;
import tletlis.network.MyIp;

/**
 *
 * @author OLBZINATOR^^^MTHfCKr
 */
public class GUI extends javax.swing.JFrame {

    /** Creates new form GUI */
    public GUI() {

        
        initComponents();
        paintGame.setSize(new Dimension(250,500));
        this.setTitle("Tletlis ©");
        setVisible(true);
        this.panelPlayer2.setVisible(false);
    }

    /**
     * Method to get the panel which is the main gameboard
     * @return the main gamearea JPanel
     */
    public JPanel getGameBoard() {
        return paintGame;
    }
    /**
     * Method that returns the nextBrickPanel
     * @return the panel intended to show next Brick
     */
    public JPanel getNextBrickPanel() {
        return nextBrickPanel;
    }

    public List<Component> getComps() {
        List<Component> jClist = new ArrayList<Component>();
        Component[] comp = getComponents();
        for(Component c:comp) {
            jClist.add(c);
        }
        jClist.add(this);
        
        return jClist;
    }



    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        paintGame = new javax.swing.JPanel();
        nextBrickLabel = new javax.swing.JLabel();
        nextBrickPanel = new javax.swing.JPanel();
        panelPlayer1 = new javax.swing.JPanel();
        player1Label = new javax.swing.JLabel();
        rowLabel = new javax.swing.JLabel();
        player1Rows = new javax.swing.JLabel();
        scoreLabel1 = new javax.swing.JLabel();
        setScoreLabel1 = new javax.swing.JLabel();
        playerLabelText1 = new javax.swing.JLabel();
        ipLabel = new javax.swing.JLabel();
        panelPlayer2 = new javax.swing.JPanel();
        rowLabel2 = new javax.swing.JLabel();
        playerLabelText2 = new javax.swing.JLabel();
        player2Rows = new javax.swing.JLabel();
        player2Label = new javax.swing.JLabel();
        scoreLabel2 = new javax.swing.JLabel();
        setScoreLabel2 = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        jButton2 = new javax.swing.JButton();
        jButton1 = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setResizable(false);

        paintGame.setBackground(new java.awt.Color(0, 0, 0));
        paintGame.setMinimumSize(new java.awt.Dimension(250, 500));
        paintGame.setName("paintGame"); // NOI18N
        paintGame.setPreferredSize(new java.awt.Dimension(250, 500));

        javax.swing.GroupLayout paintGameLayout = new javax.swing.GroupLayout(paintGame);
        paintGame.setLayout(paintGameLayout);
        paintGameLayout.setHorizontalGroup(
            paintGameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 250, Short.MAX_VALUE)
        );
        paintGameLayout.setVerticalGroup(
            paintGameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 500, Short.MAX_VALUE)
        );

        nextBrickLabel.setBackground(new java.awt.Color(255, 255, 102));
        nextBrickLabel.setFont(new java.awt.Font("Tahoma", 1, 18));
        nextBrickLabel.setText("Next Brick:");
        nextBrickLabel.setName("nextBrickLabel"); // NOI18N

        nextBrickPanel.setBackground(new java.awt.Color(0, 0, 0));
        nextBrickPanel.setName("nextBrickPanel"); // NOI18N
        nextBrickPanel.setPreferredSize(new java.awt.Dimension(150, 100));

        javax.swing.GroupLayout nextBrickPanelLayout = new javax.swing.GroupLayout(nextBrickPanel);
        nextBrickPanel.setLayout(nextBrickPanelLayout);
        nextBrickPanelLayout.setHorizontalGroup(
            nextBrickPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 153, Short.MAX_VALUE)
        );
        nextBrickPanelLayout.setVerticalGroup(
            nextBrickPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 100, Short.MAX_VALUE)
        );

        panelPlayer1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        panelPlayer1.setName("panelPlayer1"); // NOI18N

        player1Label.setBackground(new java.awt.Color(255, 255, 0));
        player1Label.setFont(new java.awt.Font("Tahoma", 1, 14));
        player1Label.setText("Player1");
        player1Label.setName("player1Label"); // NOI18N

        rowLabel.setBackground(new java.awt.Color(0, 204, 204));
        rowLabel.setFont(new java.awt.Font("Tahoma", 1, 14));
        rowLabel.setText("Rows:");
        rowLabel.setName("rowLabel"); // NOI18N

        player1Rows.setBackground(new java.awt.Color(204, 51, 255));
        player1Rows.setFont(new java.awt.Font("Tahoma", 1, 14));
        player1Rows.setText("100");
        player1Rows.setName("player1Rows"); // NOI18N

        scoreLabel1.setBackground(new java.awt.Color(51, 255, 51));
        scoreLabel1.setFont(new java.awt.Font("Tahoma", 1, 14));
        scoreLabel1.setText("Score:");
        scoreLabel1.setName("scoreLabel1"); // NOI18N

        setScoreLabel1.setBackground(new java.awt.Color(102, 102, 0));
        setScoreLabel1.setFont(new java.awt.Font("Tahoma", 1, 14));
        setScoreLabel1.setText("100000");
        setScoreLabel1.setName("setScoreLabel1"); // NOI18N

        playerLabelText1.setFont(new java.awt.Font("Tahoma", 1, 14));
        playerLabelText1.setText("Player:");
        playerLabelText1.setName("playerLabelText1"); // NOI18N

        ipLabel.setFont(new java.awt.Font("Tahoma", 1, 14));
        ipLabel.setName("ipLabel"); // NOI18N

        javax.swing.GroupLayout panelPlayer1Layout = new javax.swing.GroupLayout(panelPlayer1);
        panelPlayer1.setLayout(panelPlayer1Layout);
        panelPlayer1Layout.setHorizontalGroup(
            panelPlayer1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelPlayer1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panelPlayer1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelPlayer1Layout.createSequentialGroup()
                        .addComponent(rowLabel)
                        .addGap(18, 18, 18)
                        .addComponent(player1Rows))
                    .addGroup(panelPlayer1Layout.createSequentialGroup()
                        .addComponent(playerLabelText1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(player1Label, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(panelPlayer1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(ipLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, panelPlayer1Layout.createSequentialGroup()
                            .addComponent(scoreLabel1)
                            .addGap(18, 18, 18)
                            .addComponent(setScoreLabel1))))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        panelPlayer1Layout.setVerticalGroup(
            panelPlayer1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelPlayer1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(panelPlayer1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(playerLabelText1)
                    .addComponent(player1Label, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelPlayer1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(rowLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(player1Rows, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelPlayer1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(scoreLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(setScoreLabel1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(ipLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        panelPlayer2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        panelPlayer2.setName("panelPlayer2"); // NOI18N

        rowLabel2.setBackground(new java.awt.Color(0, 204, 204));
        rowLabel2.setFont(new java.awt.Font("Tahoma", 1, 14));
        rowLabel2.setName("rowLabel2"); // NOI18N

        playerLabelText2.setFont(new java.awt.Font("Tahoma", 1, 14));
        playerLabelText2.setName("playerLabelText2"); // NOI18N

        player2Rows.setBackground(new java.awt.Color(204, 51, 255));
        player2Rows.setFont(new java.awt.Font("Tahoma", 1, 14));
        player2Rows.setName("player2Rows"); // NOI18N

        player2Label.setBackground(new java.awt.Color(255, 255, 0));
        player2Label.setFont(new java.awt.Font("Tahoma", 1, 14));
        player2Label.setName("player2Label"); // NOI18N

        scoreLabel2.setFont(new java.awt.Font("Tahoma", 1, 14));
        scoreLabel2.setName("scoreLabel2"); // NOI18N

        setScoreLabel2.setFont(new java.awt.Font("Tahoma", 1, 14));
        setScoreLabel2.setName("setScoreLabel2"); // NOI18N

        javax.swing.GroupLayout panelPlayer2Layout = new javax.swing.GroupLayout(panelPlayer2);
        panelPlayer2.setLayout(panelPlayer2Layout);
        panelPlayer2Layout.setHorizontalGroup(
            panelPlayer2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelPlayer2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panelPlayer2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(playerLabelText2, javax.swing.GroupLayout.DEFAULT_SIZE, 58, Short.MAX_VALUE)
                    .addGroup(panelPlayer2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(scoreLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(rowLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 58, Short.MAX_VALUE)))
                .addGroup(panelPlayer2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(panelPlayer2Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(panelPlayer2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(setScoreLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 67, Short.MAX_VALUE)
                            .addComponent(player2Rows, javax.swing.GroupLayout.DEFAULT_SIZE, 67, Short.MAX_VALUE)))
                    .addGroup(panelPlayer2Layout.createSequentialGroup()
                        .addGap(8, 8, 8)
                        .addComponent(player2Label, javax.swing.GroupLayout.DEFAULT_SIZE, 53, Short.MAX_VALUE)
                        .addGap(12, 12, 12)))
                .addContainerGap())
        );
        panelPlayer2Layout.setVerticalGroup(
            panelPlayer2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(panelPlayer2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(panelPlayer2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(playerLabelText2, javax.swing.GroupLayout.DEFAULT_SIZE, 26, Short.MAX_VALUE)
                    .addComponent(player2Label, javax.swing.GroupLayout.DEFAULT_SIZE, 26, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(panelPlayer2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(player2Rows, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(rowLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 28, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(panelPlayer2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(setScoreLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 32, Short.MAX_VALUE)
                    .addComponent(scoreLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 32, Short.MAX_VALUE))
                .addGap(18, 18, 18))
        );

        jPanel1.setFocusable(false);
        jPanel1.setName("jPanel1"); // NOI18N
        jPanel1.setRequestFocusEnabled(false);

        jButton2.setText("Quit");
        jButton2.setFocusPainted(false);
        jButton2.setFocusable(false);
        jButton2.setName("quitButton"); // NOI18N
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jButton1.setText("Main Menu");
        jButton1.setFocusPainted(false);
        jButton1.setFocusable(false);
        jButton1.setName("menuButton"); // NOI18N
        jButton1.setRequestFocusEnabled(false);
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jButton1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButton2)
                .addContainerGap(27, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton1)
                    .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(53, 53, 53))
        );

        jButton1.getAccessibleContext().setAccessibleName("menuButton");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(38, 38, 38)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(nextBrickLabel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 198, Short.MAX_VALUE)
                            .addComponent(panelPlayer2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addComponent(nextBrickPanel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 153, Short.MAX_VALUE)
                                .addComponent(panelPlayer1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(28, 28, 28)
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(paintGame, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(26, 26, 26))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(paintGame, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(nextBrickLabel)
                        .addGap(18, 18, 18)
                        .addComponent(nextBrickPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(33, 33, 33)
                        .addComponent(panelPlayer1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(29, 29, 29)
                        .addComponent(panelPlayer2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        System.exit(0);
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        JFrame welcome = new WelcomeScreen();
        welcome.setSize(500, 625);
        welcome.setVisible(true);
        this.dispose();
    }//GEN-LAST:event_jButton1ActionPerformed

    

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel ipLabel;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JLabel nextBrickLabel;
    private javax.swing.JPanel nextBrickPanel;
    private javax.swing.JPanel paintGame;
    private javax.swing.JPanel panelPlayer1;
    private javax.swing.JPanel panelPlayer2;
    private javax.swing.JLabel player1Label;
    private javax.swing.JLabel player1Rows;
    private javax.swing.JLabel player2Label;
    private javax.swing.JLabel player2Rows;
    private javax.swing.JLabel playerLabelText1;
    private javax.swing.JLabel playerLabelText2;
    private javax.swing.JLabel rowLabel;
    private javax.swing.JLabel rowLabel2;
    private javax.swing.JLabel scoreLabel1;
    private javax.swing.JLabel scoreLabel2;
    private javax.swing.JLabel setScoreLabel1;
    private javax.swing.JLabel setScoreLabel2;
    // End of variables declaration//GEN-END:variables

    /**
     * Sets the player name on gui
     * @param name, the name of the player
     */
   public void setName(String name){
       player1Label.setText(name);
   }
   /**
    * Sets the ip on the gui.
    * @param ip, local computers ip-address
    */
   public void setIpLabel(String ip){
       this.ipLabel.setText("Your ip: "+ip);
   }

   /**
    * Sets opponents name on gui.
    * @param name, the name of the opponent
    */
   public void setOponentName(String name){
       player2Label.setText(name);
       rowLabel2.setText("Rows: ");
       playerLabelText2.setText("Player:");
       panelPlayer2.setVisible(true);
       player2Rows.setText("0"); 
       scoreLabel2.setText("Score:");
       setScoreLabel2.setText("0");

       //hide ip label
       ipLabel.setVisible(false);

   }
   /**
     * Updates the score on the GUI
     * @param score The score
     * @param totRows The total number of rows
     */
       public void updateScore(int score, int rows) {
        setScoreLabel1.setText(Integer.toString(score));
        player1Rows.setText(Integer.toString(rows));
    }
    /**
     * Updates the opponents score on the GUI
     * @param score The score
     * @param totRows The total number of rows
     */
    public void updateOponentScore(int score, int rows){
        setScoreLabel2.setText(Integer.toString(score));
        player2Rows.setText(Integer.toString(rows));
    }
}
